﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MuseLibrary.Packets
{
    public class BatteryPacket : Packet
    {
        internal BatteryPacket()
        {

        }

        protected override void DoInitialisation()
        {
            _percentageBatteryRemaining = _rawData.To16BitInteger(1);
            _batteryMillivoltsFuelGauge = _rawData.To16BitInteger(3);
            _batteryMillivoltsADC = _rawData.To16BitInteger(5);
            _temperatureCelsius = _rawData.To16BitInteger(7);
        }

        private int _percentageBatteryRemaining;
        private int _batteryMillivoltsFuelGauge;
        private int _batteryMillivoltsADC;
        private int _temperatureCelsius;

        public int PercentageBatteryRemaining
        {
            get { return _percentageBatteryRemaining; }
        }

        public int BatteryMillivoltsFuelGauge
        {
            get { return _batteryMillivoltsFuelGauge; }
        }

        public int BatteryMillivoltsADC
        {
            get { return _batteryMillivoltsADC; }
        }

        public int TemperatureCelsius
        {
            get { return _temperatureCelsius; }
        }

        public override PacketType Type
        {
            get { return PacketType.Battery; }
        }

        public override int Length
        {
            get { return 9; }
        }
    }
}
